import {isEmpty} from '@/utils/CommonUtils';

let myStorage = localStorage;
export default {
  storage: myStorage,
  getObject(key) {
    let value = myStorage.getItem(key);
    if (isEmpty(value)) return null;
    return JSON.parse(value);
  },
  getItem(key) {
    return myStorage.getItem(key);
  },
  setItem(key, value) {
    return myStorage.setItem(key, value);
  },
  setObject(key, value) {
    return myStorage.setItem(key, JSON.stringify(value));
  },
};
